import Vue from 'vue'
import Vuex from 'vuex'

import auth from '@/store/moduleAuth.js' 
import api from '@/store/moduleApi.js'

Vue.use(Vuex)

const store = new Vuex.Store({
	state:{
		uid:1,
		accessToken:null,	//验证Token
		refreshToken:null,	//刷新用Token
	},
	getters:{
		//是否已经登录
		isLogin:(state,getter)=>{
			return state.accessToken!=null&&state.refreshToken!=null
		},
	},
	modules:{
		auth:auth,
		api:api
	}
})

export default store